<template>
    <div class="DaySongsRecom">
        <div class="main">
            <div class="head">
                <div class="time">
                    <div class="day" v-text="$route.query.day"></div>
                    <div class="date" v-text="$route.query.date"></div>
                </div>
                <div class="title_tip">
                    <div class="title">每日歌曲推荐</div>
                    <div class="tip">根据你的音乐口味生成,每天6:00更新</div>
                </div>
            </div>
            <div class="body">
                <div class="operation">
                    <div class="left">
                        <div class="playAll iconfont iconshipin">播放全部</div>
                        <div class="iconfont iconzengjia"></div>
                    </div>
                    <div class="subAll iconfont iconxihuan">收藏全部</div>
                </div>
                <musicList :songList = songList :playListId = "playListId" />
            </div>
        </div>
    </div>
</template>

<script>
import musicList from '../../components/content/playList/musicList'
import {_getRecommendSongs} from '../../network/findMusic'
import {dtFormat} from '../../util/tool'
export default {
    name: 'DaySongsRecom',
    props: [

    ],
    data() {
        return {
            songList:[],
            playListId:0,

        };
    },
    computed: {

    },
    created() {
        let _this = this
        let cookie = sessionStorage.getItem('cloud_cookie')  
        _getRecommendSongs(cookie)
        .then(res => {
            console.log(res.data.data)
            for(let val of res.data.data.dailySongs){
                // 歌曲相关原唱，插曲等
                if(val.alia.length > 0){
                    val.name = val.name + '(' +val.alia + ')'
                }
                this.songList.push(val)
            }
        })         
    },
    mounted() {

    },
    watch: {

    },
    methods: {

    },
    components: {
        musicList,
    },
};
</script>

<style scoped lang="less">
@mainColor:#2f3640;
@itemecolor:#E03F40;
@secondColor:#ccc;
@textColor:#fff;
@borderColor:#ECECEE;
.btn_style{
    border-radius: 5px;
    padding: 7px;
    margin-right: 10px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.5);
    cursor: pointer;
    background-color: #192a56
};
.position_flex(@jc:space-between,@ai:center){
  display: flex;
  align-items: @ai;
  justify-content: @jc;
}
.DaySongsRecom{
    width: 100%;
    height: calc(100vh - 49px * 2);
    background-color: #2f3640;
    // background-image: url('../../assets/img/nike2.jpg');
    // background-repeat: no-repeat;
    overflow: auto;
    color: @textColor;
    .main{
        width: 95%;
        margin: auto;
        .head,.body{
            margin: 20px 0
        }
        .head{
            .position_flex(flex-start,top);
            padding-bottom: 20px;
            .time{
                width: 100px;
                height: 110px;
                position: relative;
                background-color: @textColor;
                border: 1px solid #ccc;
                .day{
                    position: absolute;
                    top: 10%;
                    font-size: 16px;
                    color: #666666;
                };
                .date{
                    position: absolute;
                    top: 35%;
                    font-size: 60px;
                    color: #E03F40;
                }
                .day,.date{
                    left: 50%;
                    transform: translateX(-50%);
                    
                }
            }
            .title_tip{
                div{
                    margin: 20px;
                }
                .title{
                    font-size: 30px;
                }
                .tip{
                    font-size: 12px;
                    color: @secondColor;
                }
            }
        }
        .body{
            width: 100%;
            border: 1px solid #40739e;
            .operation{
                .position_flex;
                .left,.subAll{
                    margin: 10px 10px
                }
                .left{
                    .position_flex(flex-start);
                    div{ 
                        .btn_style;
                        background-color: @itemecolor;
                    }
                }
                .subAll{
                    .btn_style;
                }
                .left>div:hover,.subAll:hover{
                    background-color: #ccc;
                }
                
            }
        }
    }
}
</style>
